# Contributor: guddaff <guddaff@protonmail.com>
# Maintainer: guddaff <guddaff@protonmail.com>
pkgname=rustscan
pkgver=2.1.1
pkgrel=1
pkgdesc="Modern Port Scanner"
url="https://github.com/RustScan/RustScan"
license="GPL-3.0-or-later"
# ppc64le and s390x and riscv64 blocked by ring crate
# armhf timout while building
arch="all !ppc64le !armhf !s390x !riscv64"
makedepends="cargo cargo-auditable"
checkdepends="bash perl python3"
source="https://github.com/RustScan/RustScan/archive/$pkgver/rustscan-$pkgver.tar.gz
	Cargo.lock.patch
	"
options="net"
builddir="$srcdir/RustScan-$pkgver"


prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/rustscan -t "$pkgdir"/usr/bin/
}

sha512sums="
b435e03575cb6b9989615574beed537a47a92a17566df9cb678d8ea1d8aeaf651c4b1e1700b72af5c78a00921e99df59d0f4bfc34e698a8066cabcf42a4c867d  rustscan-2.1.1.tar.gz
8733e358eb6c3a0f2e155f6f779331c5f074eb0d83c55eb49caf4e579946dde7c27f941da8f28824b2f522fadf3ff47255d0e7a68b1904a49336b63405e5f31d  Cargo.lock.patch
"
